﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace CommunitySystemModel
{
    [Serializable]
    [DataContract]
    public class JinShengDetailModel
    {
        private int _Sec;
        [DataMember]
        public int Sec
        {
            get { return _Sec; }
            set { _Sec = value; }
        }
        private int _ID;
        [DataMember]
        public int ID
        {
            get { return _ID; }
            set { _ID = value; }
        }
        private int _JinShengID;
        [DataMember]
        public int JinShengID
        {
            get { return _JinShengID; }
            set { _JinShengID = value; }
        }
        private int _EmpbasicID;
        [DataMember]
        public int EmpbasicID
        {
            get { return _EmpbasicID; }
            set { _EmpbasicID = value; }
        }
        private bool _IsFuHeYaoQiu = true;
        [DataMember]
        public bool IsFuHeYaoQiu
        {
            get { return _IsFuHeYaoQiu; }
            set { _IsFuHeYaoQiu = value; }
        }

        public static JinShengDetailModel FillEntity(DataRow dr)
        {
            JinShengDetailModel right = new JinShengDetailModel();
            if (dr.Table != null && dr.Table.Columns.Contains("Sec")) if (!string.IsNullOrEmpty(dr["Sec"].ToString())) right.Sec = Convert.ToInt32(dr["Sec"]);
            if (dr.Table != null && dr.Table.Columns.Contains("ID")) if (!string.IsNullOrEmpty(dr["ID"].ToString())) right.ID = (int)dr["ID"];
            if (dr.Table != null && dr.Table.Columns.Contains("JinShengID")) if (!string.IsNullOrEmpty(dr["JinShengID"].ToString())) right.JinShengID = Convert.ToInt32(dr["JinShengID"]);
            if (dr.Table != null && dr.Table.Columns.Contains("EmpbasicID")) if (!string.IsNullOrEmpty(dr["EmpbasicID"].ToString())) right.EmpbasicID = (int)dr["EmpbasicID"];
            if (dr.Table != null && dr.Table.Columns.Contains("IsFuHeYaoQiu")) if (!string.IsNullOrEmpty(dr["IsFuHeYaoQiu"].ToString())) right.IsFuHeYaoQiu = Convert.ToBoolean(dr["IsFuHeYaoQiu"]);
            return right;
        }
    }
}
